package com.ys.erp.stage_mall_service.bean.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ys.erp.common.util.DateUtil;
import com.ys.erp.entity.data.bean.MallHomeActivityCoupons;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @author minamiyama
 * @date 2025/5/28 17:27
 */
@Data
@Schema(description = "营销活动详情相关返回对象")
public class HomeActivityInfoVO {

    @Schema(description = "活动id")
    private Long id;
    @Schema(description = "活动类型")
    private String activityType;

    @Schema(description = "活动名称")
    private String activityName;

    @Schema(description = "活动开始时间")
    @JsonFormat(pattern = DateUtil.TIME_FORMAT, timezone = "GMT+8")
    private LocalDateTime startTime;

    @Schema(description = "活动结束时间")
    @JsonFormat(pattern = DateUtil.TIME_FORMAT, timezone = "GMT+8")
    private LocalDateTime endTime;

    @Schema(description = "位置")
    private Integer location;

    @Schema(description = "营销活动卡卷对象")
    private List<ActivityCouponsInfoVO> activityCouponsInfoVOList;

    @Schema(description = "活动商品数量")
    private List<GoodsInfoVO> goodsNum;

    @Schema(description = "状态")
    private Integer status;


    @Data
    @Schema(description = "营销活动卡卷详情对象")
    public static class ActivityCouponsInfoVO {

        @Schema(description = "卡卷id集")
        private Long couponsId;

        @Schema(description = "发放方式")
        private String sendMethod;

        @Schema(description = "发放数量")
        private Long sendNum;

        @Schema(description = "领用规则")
        private MallHomeActivityCoupons.AdoptRuleDTO adoptRule;

        @Schema(description = "是否定时")
        private Integer isTiming;

        @Schema(description = "定时规则")
        private MallHomeActivityCoupons.TimingRuleDTO timIngRule;

        @Schema(description = "是否自动")
        private Integer isAuto;
    }


    @Data
    @Schema(description = "活动所配置的商品返回对象")
    public static class GoodsInfoVO {

        @Schema(description = "商品id")
        private Long goodsId;

        @Schema(description = "商品品牌")
        private String brandName;

        @Schema(description = "商品图片")
        private String goodsImage;

        @Schema(description = "商品名称")
        private String goodsName;

        @Schema(description = "商品价格")
        private String price;

        @Schema(description = "幺币抵扣率")
        private String ysCoinDiscount;

        @Schema(description = "商品发货方式")
        private String sendGoodsMethod;

        @Schema(description = "商品库存")
        private Integer stock;

        @Schema(description = "是否主区展示")
        private Integer isMainAreaDis;


    }


}
